/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'idrsservice.aliyuncs.com',
    ap-northeast-2-pop = 'idrsservice.aliyuncs.com',
    ap-south-1 = 'idrsservice.aliyuncs.com',
    ap-southeast-1 = 'idrsservice.aliyuncs.com',
    ap-southeast-2 = 'idrsservice.aliyuncs.com',
    ap-southeast-3 = 'idrsservice.aliyuncs.com',
    ap-southeast-5 = 'idrsservice.aliyuncs.com',
    cn-beijing = 'idrsservice.aliyuncs.com',
    cn-beijing-finance-1 = 'idrsservice.aliyuncs.com',
    cn-beijing-finance-pop = 'idrsservice.aliyuncs.com',
    cn-beijing-gov-1 = 'idrsservice.aliyuncs.com',
    cn-beijing-nu16-b01 = 'idrsservice.aliyuncs.com',
    cn-chengdu = 'idrsservice.aliyuncs.com',
    cn-edge-1 = 'idrsservice.aliyuncs.com',
    cn-fujian = 'idrsservice.aliyuncs.com',
    cn-haidian-cm12-c01 = 'idrsservice.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'idrsservice.aliyuncs.com',
    cn-hangzhou-finance = 'idrsservice.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'idrsservice.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'idrsservice.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'idrsservice.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'idrsservice.aliyuncs.com',
    cn-hangzhou-test-306 = 'idrsservice.aliyuncs.com',
    cn-hongkong = 'idrsservice.aliyuncs.com',
    cn-hongkong-finance-pop = 'idrsservice.aliyuncs.com',
    cn-huhehaote = 'idrsservice.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'idrsservice.aliyuncs.com',
    cn-north-2-gov-1 = 'idrsservice.aliyuncs.com',
    cn-qingdao = 'idrsservice.aliyuncs.com',
    cn-qingdao-nebula = 'idrsservice.aliyuncs.com',
    cn-shanghai = 'idrsservice.aliyuncs.com',
    cn-shanghai-et15-b01 = 'idrsservice.aliyuncs.com',
    cn-shanghai-et2-b01 = 'idrsservice.aliyuncs.com',
    cn-shanghai-inner = 'idrsservice.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'idrsservice.aliyuncs.com',
    cn-shenzhen = 'idrsservice.aliyuncs.com',
    cn-shenzhen-finance-1 = 'idrsservice.aliyuncs.com',
    cn-shenzhen-inner = 'idrsservice.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'idrsservice.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'idrsservice.aliyuncs.com',
    cn-wuhan = 'idrsservice.aliyuncs.com',
    cn-wulanchabu = 'idrsservice.aliyuncs.com',
    cn-yushanfang = 'idrsservice.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'idrsservice.aliyuncs.com',
    cn-zhangjiakou = 'idrsservice.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'idrsservice.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'idrsservice.aliyuncs.com',
    eu-central-1 = 'idrsservice.aliyuncs.com',
    eu-west-1 = 'idrsservice.aliyuncs.com',
    eu-west-1-oxs = 'idrsservice.aliyuncs.com',
    me-east-1 = 'idrsservice.aliyuncs.com',
    rus-west-1-pop = 'idrsservice.aliyuncs.com',
    us-east-1 = 'idrsservice.aliyuncs.com',
    us-west-1 = 'idrsservice.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('idrsservice', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AsrRealtimeRequest {
  appId?: string(name='AppId', example='4a29b426-742f-4078-8386-79b440b25***'),
  customizationId?: string(name='CustomizationId'),
  disfluency?: boolean(name='Disfluency', example='false'),
  enableIgnoreSentenceTimeout?: boolean(name='EnableIgnoreSentenceTimeout', example='false'),
  enableIntermediateResult?: boolean(name='EnableIntermediateResult', example='false'),
  enableInverseTextNormalization?: boolean(name='EnableInverseTextNormalization', example='false'),
  enablePunctuationPrediction?: boolean(name='EnablePunctuationPrediction', example='false'),
  enableSemanticSentenceDetection?: boolean(name='EnableSemanticSentenceDetection', example='false'),
  enableWords?: boolean(name='EnableWords', example='false'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/bmw-prod/0574ee2e-f494-45a5-820f-63aee***.wav'),
  format?: string(name='Format', example='PCM'),
  maxSentenceSilence?: long(name='MaxSentenceSilence', example='800'),
  sampleRate?: long(name='SampleRate', example='16000'),
  speechNoiseThreshold?: float(name='SpeechNoiseThreshold', example='0.3'),
  vocabularyId?: string(name='VocabularyId'),
}

model AsrRealtimeResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    beginTime?: long(name='BeginTime', example='1649952000000'),
    code?: int32(name='Code', example='OK'),
    confidence?: double(name='Confidence', example='0.78'),
    id?: string(name='Id', example='f3bd31c0-0001-4b4b-977d-7cfa64b5***'),
    message?: string(name='Message'),
    name?: string(name='Name', example='default'),
    result?: string(name='Result'),
    status?: string(name='Status', example='completed'),
    taskId?: string(name='TaskId', example='368cfa55-2364-4d79-aeb4-c0956c4a4***'),
    time?: long(name='Time', example='1638243477'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD50***'),
  success?: boolean(name='Success', example='True'),
}

model AsrRealtimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AsrRealtimeResponseBody(name='body'),
}

async function asrRealtimeWithOptions(request: AsrRealtimeRequest, runtime: Util.RuntimeOptions): AsrRealtimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.customizationId)) {
    query['CustomizationId'] = request.customizationId;
  }
  if (!Util.isUnset(request.disfluency)) {
    query['Disfluency'] = request.disfluency;
  }
  if (!Util.isUnset(request.enableIgnoreSentenceTimeout)) {
    query['EnableIgnoreSentenceTimeout'] = request.enableIgnoreSentenceTimeout;
  }
  if (!Util.isUnset(request.enableIntermediateResult)) {
    query['EnableIntermediateResult'] = request.enableIntermediateResult;
  }
  if (!Util.isUnset(request.enableInverseTextNormalization)) {
    query['EnableInverseTextNormalization'] = request.enableInverseTextNormalization;
  }
  if (!Util.isUnset(request.enablePunctuationPrediction)) {
    query['EnablePunctuationPrediction'] = request.enablePunctuationPrediction;
  }
  if (!Util.isUnset(request.enableSemanticSentenceDetection)) {
    query['EnableSemanticSentenceDetection'] = request.enableSemanticSentenceDetection;
  }
  if (!Util.isUnset(request.enableWords)) {
    query['EnableWords'] = request.enableWords;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.format)) {
    query['Format'] = request.format;
  }
  if (!Util.isUnset(request.maxSentenceSilence)) {
    query['MaxSentenceSilence'] = request.maxSentenceSilence;
  }
  if (!Util.isUnset(request.sampleRate)) {
    query['SampleRate'] = request.sampleRate;
  }
  if (!Util.isUnset(request.speechNoiseThreshold)) {
    query['SpeechNoiseThreshold'] = request.speechNoiseThreshold;
  }
  if (!Util.isUnset(request.vocabularyId)) {
    query['VocabularyId'] = request.vocabularyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AsrRealtime',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function asrRealtime(request: AsrRealtimeRequest): AsrRealtimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return asrRealtimeWithOptions(request, runtime);
}

model AsrSentenceRequest {
  asrRequest?: {
    appId?: string(name='AppId', example='d61be709-49d2-4cf1-b219-cd6181f72db8'),
    enableInverseTextNormalization?: boolean(name='EnableInverseTextNormalization', example='false'),
    enablePunctuationPrediction?: boolean(name='EnablePunctuationPrediction', example='false'),
    enableVoiceDetection?: boolean(name='EnableVoiceDetection', example='false'),
    fileUrl?: string(name='FileUrl', example='http://shuanglu-record-finance.oss-cn-shanghai.aliyuncs.com/record/4x5avhil/047730_30307_0/2022-02-12-10-20****'),
    format?: string(name='Format', example='PCM'),
    sampleRate?: int32(name='SampleRate', example='16000'),
  }(name='AsrRequest'),
}

model AsrSentenceShrinkRequest {
  asrRequestShrink?: string(name='AsrRequest'),
}

model AsrSentenceResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    code?: int32(name='Code', example='20000000'),
    id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    message?: string(name='Message', example='-'),
    name?: string(name='Name'),
    result?: string(name='Result'),
    taskId?: string(name='TaskId', example='368cfa55-2364-4d79-aeb4-c0956c4a45cd'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  success?: boolean(name='Success', example='True'),
}

model AsrSentenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AsrSentenceResponseBody(name='body'),
}

async function asrSentenceWithOptions(tmpReq: AsrSentenceRequest, runtime: Util.RuntimeOptions): AsrSentenceResponse {
  Util.validateModel(tmpReq);
  var request = new AsrSentenceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.asrRequest)) {
    request.asrRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.asrRequest, 'AsrRequest', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.asrRequestShrink)) {
    body['AsrRequest'] = request.asrRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AsrSentence',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function asrSentence(request: AsrSentenceRequest): AsrSentenceResponse {
  var runtime = new Util.RuntimeOptions{};
  return asrSentenceWithOptions(request, runtime);
}

model AsrTaskRequest {
  request?: {
    appId?: string(name='AppId', example='d9ee5df9-20bf-47bf-987a-76b26984b***'),
    asrTaskId?: string(name='AsrTaskId', example='d9ee5df9-20bf-47bf-987a-76b26984b***'),
    event?: string(name='Event', example='START'),
    roomId?: string(name='RoomId', example='662027426755***'),
    timestamp?: long(name='Timestamp', example='1656388156399'),
  }(name='Request'),
}

model AsrTaskShrinkRequest {
  requestShrink?: string(name='Request'),
}

model AsrTaskResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    result?: string(name='Result'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='DF4B0162-A5E0-5F85-BEFD-CAC36E876***'),
  success?: boolean(name='Success', example='True'),
}

model AsrTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AsrTaskResponseBody(name='body'),
}

async function asrTaskWithOptions(tmpReq: AsrTaskRequest, runtime: Util.RuntimeOptions): AsrTaskResponse {
  Util.validateModel(tmpReq);
  var request = new AsrTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.request)) {
    request.requestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.request, 'Request', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.requestShrink)) {
    body['Request'] = request.requestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AsrTask',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function asrTask(request: AsrTaskRequest): AsrTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return asrTaskWithOptions(request, runtime);
}

model AssociateRoomRequest {
  appId?: string(name='AppId', example='5bbfb884-1186-4d48-906b-88d586770f6b'),
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  clientVersion?: string(name='ClientVersion', example='1.0.002'),
  departmentId?: string(name='DepartmentId', example='5bbfb884-1186-4d48-906b-88d586770f6b'),
  roomId?: string(name='RoomId', example='5500707344661'),
}

model AssociateRoomResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: string(name='Data', example='{\\"Name\\": u\\"\\u4ee3\\u7406\\u4eba\\", \\"CreatedAt\\": \\"2021-11-11T15:27:39.449+08:00\\", \\"Channel\\": \\"063756\\", \\"Id\\": \\"5ead2d7f-9e2c-4521-bac4-e37bd44b6a56\\"}'),
  errors?: [ 
    {
      field?: string(name='Field', example='-'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
  success?: boolean(name='Success', example='True'),
}

model AssociateRoomResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateRoomResponseBody(name='body'),
}

async function associateRoomWithOptions(request: AssociateRoomRequest, runtime: Util.RuntimeOptions): AssociateRoomResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.roomId)) {
    query['RoomId'] = request.roomId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateRoom',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateRoom(request: AssociateRoomRequest): AssociateRoomResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateRoomWithOptions(request, runtime);
}

model CreateAppRequest {
  clientToken?: string(name='ClientToken', example='4367c30a-c686-4bb2-a45d-5affb87****'),
  departmentId?: string(name='DepartmentId', example='4367c30a-c686-4bb2-a45d-5affb87f7aca'),
  name?: string(name='Name'),
  packageName?: string(name='PackageName', example='com.test.app'),
}

model CreateAppResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    creatorName?: string(name='CreatorName'),
    disabled?: boolean(name='Disabled', example='false'),
    id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model CreateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppResponseBody(name='body'),
}

async function createAppWithOptions(request: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateDepartmentRequest {
  clientToken?: string(name='ClientToken'),
  description?: string(name='Description'),
  label?: string(name='Label'),
  name?: string(name='Name'),
}

model CreateDepartmentResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    description?: string(name='Description'),
    id?: string(name='Id', example='63bb629d-92bf-4cdc-ad0b-3032c926d23f'),
    name?: string(name='Name'),
  }(name='Data'),
  message?: string(name='Message', example='11111111'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model CreateDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDepartmentResponseBody(name='body'),
}

async function createDepartmentWithOptions(request: CreateDepartmentRequest, runtime: Util.RuntimeOptions): CreateDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.label)) {
    query['Label'] = request.label;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDepartment',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDepartment(request: CreateDepartmentRequest): CreateDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDepartmentWithOptions(request, runtime);
}

model CreateDetectProcessRequest {
  content?: string(name='Content', example='{}'),
  draft?: string(name='Draft', example='{}'),
  name?: string(name='Name'),
  type?: string(name='Type', example='LOCAL'),
}

model CreateDetectProcessResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-12-04T14:47:59.000+08:00'),
    disabled?: boolean(name='Disabled', example='false'),
    draft?: string(name='Draft', example='{}'),
    id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
    md5?: string(name='Md5', example='987d563d38f5aef27feca8702c689bb1'),
    name?: string(name='Name'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='0q1c45cd-3eee-1e60-b505-2e330b8755d3'),
}

model CreateDetectProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDetectProcessResponseBody(name='body'),
}

async function createDetectProcessWithOptions(request: CreateDetectProcessRequest, runtime: Util.RuntimeOptions): CreateDetectProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.draft)) {
    query['Draft'] = request.draft;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDetectProcess',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDetectProcess(request: CreateDetectProcessRequest): CreateDetectProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDetectProcessWithOptions(request, runtime);
}

model CreateRuleRequest {
  clientToken?: string(name='ClientToken'),
  content?: string(name='Content', example='[{"sequence":1,"actions":[{"name":"id_card_recognize"}]},{"sequence":2,"actions":[{"name":"document_title_recognize"},{"name":"flip_action_recognize"},{"name":"sign_action_recognize"}]},{"sequence":3,"actions":[{"name":"sign_recognize"}]},{"sequence":0,"actions":[{"name":"face_track"},{"name":"speech_to_text"}]}]'),
  name?: string(name='Name', example='default'),
}

model CreateRuleResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name', example='default'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model CreateRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRuleResponseBody(name='body'),
}

async function createRuleWithOptions(request: CreateRuleRequest, runtime: Util.RuntimeOptions): CreateRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRule',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRule(request: CreateRuleRequest): CreateRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRuleWithOptions(request, runtime);
}

model CreateSignatureRequest {
  appId?: string(name='AppId', example='5bbfb884-1186-4d48-906b-88d586770f6b'),
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  clientVersion?: string(name='ClientVersion', example='1.0.001'),
  expireTime?: long(name='ExpireTime', example='300'),
  uid?: string(name='Uid', example='550070734466****'),
}

model CreateSignatureResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    expireTime?: string(name='ExpireTime', example='300'),
    rtcAppId?: string(name='RtcAppId', example='124325213125435'),
    rtcBizName?: string(name='RtcBizName'),
    rtcSign?: string(name='RtcSign'),
    rtcWorkspaceId?: string(name='RtcWorkspaceId', example='my_workspace'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='requestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
  success?: boolean(name='Success', example='True'),
}

model CreateSignatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSignatureResponseBody(name='body'),
}

async function createSignatureWithOptions(request: CreateSignatureRequest, runtime: Util.RuntimeOptions): CreateSignatureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSignature',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSignature(request: CreateSignatureRequest): CreateSignatureResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSignatureWithOptions(request, runtime);
}

model CreateTaskGroupRequest {
  appId?: string(name='AppId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  clientToken?: string(name='ClientToken'),
  day?: [ int32 ](name='Day', example='3'),
  expireAt?: string(name='ExpireAt', example='2020-10-10'),
  groupName?: string(name='GroupName'),
  ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  runnableTimeFrom?: string(name='RunnableTimeFrom', example='17:00'),
  runnableTimeTo?: string(name='RunnableTimeTo', example='18:00'),
  triggerPeriod?: string(name='TriggerPeriod', example='immediately'),
  videoInfo?: [ 
    {
      ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
      videoMetaUrl?: string(name='VideoMetaUrl', example='18/mrtc//641905591891464_record_64190559189146412713.mp4.meta'),
      videoUrl?: string(name='VideoUrl', example='18/mrtc//641905591891464_record_64190559189146412713.mp4'),
    }
  ](name='VideoInfo'),
}

model CreateTaskGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    completedTasks?: int32(name='CompletedTasks', example='0'),
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
    ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    ruleName?: string(name='RuleName', example='default'),
    status?: string(name='Status', example='runnable'),
    taskIds?: [ string ](name='TaskIds'),
    totalTasks?: int32(name='TotalTasks', example='1'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model CreateTaskGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTaskGroupResponseBody(name='body'),
}

async function createTaskGroupWithOptions(request: CreateTaskGroupRequest, runtime: Util.RuntimeOptions): CreateTaskGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.day)) {
    query['Day'] = request.day;
  }
  if (!Util.isUnset(request.expireAt)) {
    query['ExpireAt'] = request.expireAt;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.runnableTimeFrom)) {
    query['RunnableTimeFrom'] = request.runnableTimeFrom;
  }
  if (!Util.isUnset(request.runnableTimeTo)) {
    query['RunnableTimeTo'] = request.runnableTimeTo;
  }
  if (!Util.isUnset(request.triggerPeriod)) {
    query['TriggerPeriod'] = request.triggerPeriod;
  }
  if (!Util.isUnset(request.videoInfo)) {
    query['VideoInfo'] = request.videoInfo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTaskGroup',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTaskGroup(request: CreateTaskGroupRequest): CreateTaskGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTaskGroupWithOptions(request, runtime);
}

model CreateTtsQuestionRequest {
  request?: {
    answer?: string(name='Answer'),
    question?: string(name='Question'),
    questionGroupId?: string(name='QuestionGroupId', example='47584ba4-9781-496b-8e6f-c8525a213***'),
  }(name='Request'),
}

model CreateTtsQuestionShrinkRequest {
  requestShrink?: string(name='Request'),
}

model CreateTtsQuestionResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4ba***'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='D9AA9055-F73D-592C-832B-5AEECB093***'),
  success?: boolean(name='Success', example='True'),
}

model CreateTtsQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTtsQuestionResponseBody(name='body'),
}

async function createTtsQuestionWithOptions(tmpReq: CreateTtsQuestionRequest, runtime: Util.RuntimeOptions): CreateTtsQuestionResponse {
  Util.validateModel(tmpReq);
  var request = new CreateTtsQuestionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.request)) {
    request.requestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.request, 'Request', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.requestShrink)) {
    body['Request'] = request.requestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTtsQuestion',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTtsQuestion(request: CreateTtsQuestionRequest): CreateTtsQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTtsQuestionWithOptions(request, runtime);
}

model CreateTtsQuestionGroupRequest {
  request?: {
    format?: string(name='Format', example='PCM'),
    pitchRate?: int32(name='PitchRate', example='50'),
    sampleRate?: int32(name='SampleRate', example='16000'),
    speechRate?: int32(name='SpeechRate', example='50'),
    voice?: string(name='Voice', example='xiaoyun'),
    volume?: int32(name='Volume', example='50'),
  }(name='Request'),
}

model CreateTtsQuestionGroupShrinkRequest {
  requestShrink?: string(name='Request'),
}

model CreateTtsQuestionGroupResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    id?: string(name='Id', example='63bb629d-92bf-4cdc-ad0b-3032c926d***'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='B2AADC9E-2A58-5918-AE4E-FF59E19D7***'),
  success?: boolean(name='Success', example='True'),
}

model CreateTtsQuestionGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTtsQuestionGroupResponseBody(name='body'),
}

async function createTtsQuestionGroupWithOptions(tmpReq: CreateTtsQuestionGroupRequest, runtime: Util.RuntimeOptions): CreateTtsQuestionGroupResponse {
  Util.validateModel(tmpReq);
  var request = new CreateTtsQuestionGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.request)) {
    request.requestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.request, 'Request', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.requestShrink)) {
    body['Request'] = request.requestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTtsQuestionGroup',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTtsQuestionGroup(request: CreateTtsQuestionGroupRequest): CreateTtsQuestionGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTtsQuestionGroupWithOptions(request, runtime);
}

model CreateUserDepartmentsRequest {
  clientToken?: string(name='ClientToken'),
  departmentId?: [ string ](name='DepartmentId'),
  userId?: [ string ](name='UserId'),
}

model CreateUserDepartmentsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='0B576AAB-A638-5029-9A54-A7C1DB5AC0B3'),
}

model CreateUserDepartmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserDepartmentsResponseBody(name='body'),
}

async function createUserDepartmentsWithOptions(request: CreateUserDepartmentsRequest, runtime: Util.RuntimeOptions): CreateUserDepartmentsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateUserDepartments',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createUserDepartments(request: CreateUserDepartmentsRequest): CreateUserDepartmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createUserDepartmentsWithOptions(request, runtime);
}

model CreateVideoMergeTaskRequest {
  videoMergeRequest?: {
    callbackUrl?: string(name='CallbackUrl', example='https://h5-api.neoclub.cn/v1/bff/service/other/rtc/callback'),
    layoutStyles?: [ 
      {
        height?: long(name='Height', example='3037'),
        inputNum?: long(name='InputNum', example='2'),
        videoStyles?: [ 
          {
            fileName?: string(name='FileName', example='http://xxx.xxx'),
            height?: long(name='Height', example='888'),
            positionX?: long(name='PositionX', example='100'),
            positionY?: long(name='PositionY', example='400'),
            width?: long(name='Width', example='100'),
          }
        ](name='VideoStyles'),
        width?: long(name='Width', example='800'),
      }
    ](name='LayoutStyles'),
    videoList?: [ 
      {
        endTime?: long(name='EndTime', example='2021-12-28'),
        fileName?: string(name='FileName'),
        fileUrl?: string(name='FileUrl', example='http://shuanglu-record-finance.oss-cn-shanghai.aliyuncs.com/record/4x5avhil/264516_33430_1/2022-03-21-13-56-38_2022-03-21-14-17-22.mp4'),
        mergeBeginTime?: long(name='MergeBeginTime', example='5'),
        mergeEndTime?: long(name='MergeEndTime', example='15'),
        primeVideo?: boolean(name='PrimeVideo', example='true'),
        startTime?: long(name='StartTime', example='2022-03-05'),
      }
    ](name='VideoList'),
    watermark?: {
      fontColor?: string(name='FontColor', example='14803425'),
      fontSize?: long(name='FontSize', example='20'),
      positionX?: long(name='PositionX', example='100'),
      positionY?: long(name='PositionY', example='400'),
      text?: string(name='Text'),
      timestamp?: long(name='Timestamp', example='1617245014'),
    }(name='Watermark'),
  }(name='VideoMergeRequest'),
}

model CreateVideoMergeTaskShrinkRequest {
  videoMergeRequestShrink?: string(name='VideoMergeRequest'),
}

model CreateVideoMergeTaskResponseBody = {
  code?: int32(name='Code', description='code', example='OK'),
  data?: string(name='Data', example='AC140413004421B8D17C549B31B20000'),
  message?: string(name='Message', example='-'),
  status?: boolean(name='Status', example='success'),
}

model CreateVideoMergeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateVideoMergeTaskResponseBody(name='body'),
}

async function createVideoMergeTaskWithOptions(tmpReq: CreateVideoMergeTaskRequest, runtime: Util.RuntimeOptions): CreateVideoMergeTaskResponse {
  Util.validateModel(tmpReq);
  var request = new CreateVideoMergeTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.videoMergeRequest)) {
    request.videoMergeRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoMergeRequest, 'VideoMergeRequest', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.videoMergeRequestShrink)) {
    body['VideoMergeRequest'] = request.videoMergeRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateVideoMergeTask',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createVideoMergeTask(request: CreateVideoMergeTaskRequest): CreateVideoMergeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createVideoMergeTaskWithOptions(request, runtime);
}

model CreateWatermarkRequest {
  name?: string(name='Name'),
  value?: string(name='Value', example='{}'),
}

model CreateWatermarkResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
    value?: string(name='Value', example='{}'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
  success?: boolean(name='Success', example='True'),
}

model CreateWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWatermarkResponseBody(name='body'),
}

async function createWatermarkWithOptions(request: CreateWatermarkRequest, runtime: Util.RuntimeOptions): CreateWatermarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateWatermark',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createWatermark(request: CreateWatermarkRequest): CreateWatermarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return createWatermarkWithOptions(request, runtime);
}

model DeleteAppRequest {
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model DeleteAppResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
}

model DeleteAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppResponseBody(name='body'),
}

async function deleteAppWithOptions(request: DeleteAppRequest, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApp',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DeleteDepartmentRequest {
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model DeleteDepartmentResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
}

model DeleteDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDepartmentResponseBody(name='body'),
}

async function deleteDepartmentWithOptions(request: DeleteDepartmentRequest, runtime: Util.RuntimeOptions): DeleteDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDepartment',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDepartment(request: DeleteDepartmentRequest): DeleteDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDepartmentWithOptions(request, runtime);
}

model DeleteDetectProcessRequest {
  id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
}

model DeleteDetectProcessResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data', example='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='1fdc45cd-3eee-4e60-b505-2e330b8755d3'),
}

model DeleteDetectProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDetectProcessResponseBody(name='body'),
}

async function deleteDetectProcessWithOptions(request: DeleteDetectProcessRequest, runtime: Util.RuntimeOptions): DeleteDetectProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDetectProcess',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDetectProcess(request: DeleteDetectProcessRequest): DeleteDetectProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDetectProcessWithOptions(request, runtime);
}

model DeleteRuleRequest {
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model DeleteRuleResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name', example='default'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model DeleteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRuleResponseBody(name='body'),
}

async function deleteRuleWithOptions(request: DeleteRuleRequest, runtime: Util.RuntimeOptions): DeleteRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRule',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRule(request: DeleteRuleRequest): DeleteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRuleWithOptions(request, runtime);
}

model DeleteUserRequest {
  id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model DeleteUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field'),
      message?: string(name='Message'),
    }
  ](name='Errors'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model DeleteUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserResponseBody(name='body'),
}

async function deleteUserWithOptions(request: DeleteUserRequest, runtime: Util.RuntimeOptions): DeleteUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUser',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUser(request: DeleteUserRequest): DeleteUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserWithOptions(request, runtime);
}

model DeleteUserDepartmentsRequest {
  departmentId?: [ string ](name='DepartmentId'),
  userId?: [ string ](name='UserId'),
}

model DeleteUserDepartmentsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='48A2B2E2-9995-5220-B77C-871119CB05CC'),
}

model DeleteUserDepartmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserDepartmentsResponseBody(name='body'),
}

async function deleteUserDepartmentsWithOptions(request: DeleteUserDepartmentsRequest, runtime: Util.RuntimeOptions): DeleteUserDepartmentsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserDepartments',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUserDepartments(request: DeleteUserDepartmentsRequest): DeleteUserDepartmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserDepartmentsWithOptions(request, runtime);
}

model DeleteWatermarkRequest {
  watermarkId?: string(name='WatermarkId', example='e5a923e0e727f212813a195e274b02c6'),
}

model DeleteWatermarkResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
    name?: string(name='Name'),
    value?: string(name='Value', example='{}'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
  success?: boolean(name='Success', example='True'),
}

model DeleteWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWatermarkResponseBody(name='body'),
}

async function deleteWatermarkWithOptions(request: DeleteWatermarkRequest, runtime: Util.RuntimeOptions): DeleteWatermarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWatermark',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteWatermark(request: DeleteWatermarkRequest): DeleteWatermarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteWatermarkWithOptions(request, runtime);
}

model FaceCompareRequest {
  faceRequest?: {
    appId?: string(name='AppId', example='d61be709-49d2-4cf1-b219-cd6181f72***'),
    sourceImage?: string(name='SourceImage', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
    targetImage?: string(name='TargetImage', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  }(name='FaceRequest'),
}

model FaceCompareShrinkRequest {
  faceRequestShrink?: string(name='FaceRequest'),
}

model FaceCompareResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', example='200'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    message?: string(name='Message', example='-'),
    passed?: string(name='Passed', example='T'),
    requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    status?: string(name='Status', example='completed'),
    verifyScore?: float(name='VerifyScore', example='60.86'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4ba***'),
  success?: boolean(name='Success', example='True'),
}

model FaceCompareResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FaceCompareResponseBody(name='body'),
}

async function faceCompareWithOptions(tmpReq: FaceCompareRequest, runtime: Util.RuntimeOptions): FaceCompareResponse {
  Util.validateModel(tmpReq);
  var request = new FaceCompareShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.faceRequest)) {
    request.faceRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.faceRequest, 'FaceRequest', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.faceRequestShrink)) {
    body['FaceRequest'] = request.faceRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FaceCompare',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function faceCompare(request: FaceCompareRequest): FaceCompareResponse {
  var runtime = new Util.RuntimeOptions{};
  return faceCompareWithOptions(request, runtime);
}

model FaceLivenessRequest {
  faceRequest?: {
    appId?: string(name='AppId', example='d61be709-49d2-4cf1-b219-cd6181f72***'),
    sourceImage?: string(name='SourceImage', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  }(name='FaceRequest'),
}

model FaceLivenessShrinkRequest {
  faceRequestShrink?: string(name='FaceRequest'),
}

model FaceLivenessResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', example='2000000'),
    message?: string(name='Message', example='success'),
    passed?: string(name='Passed', example='T'),
    publicId?: string(name='PublicId', example='d61be709-49d2-4cf1-b219-cd6181f72***'),
    score?: float(name='Score', example='3.24324324324'),
    status?: string(name='Status', example='COMPLETED'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='7AC54DAF-38F8-58C7-8383-3131FEDDA***'),
  success?: boolean(name='Success', example='True'),
}

model FaceLivenessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FaceLivenessResponseBody(name='body'),
}

async function faceLivenessWithOptions(tmpReq: FaceLivenessRequest, runtime: Util.RuntimeOptions): FaceLivenessResponse {
  Util.validateModel(tmpReq);
  var request = new FaceLivenessShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.faceRequest)) {
    request.faceRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.faceRequest, 'FaceRequest', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.faceRequestShrink)) {
    body['FaceRequest'] = request.faceRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FaceLiveness',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function faceLiveness(request: FaceLivenessRequest): FaceLivenessResponse {
  var runtime = new Util.RuntimeOptions{};
  return faceLivenessWithOptions(request, runtime);
}

model FaceRecognizeRequest {
  faceRequest?: {
    appId?: string(name='AppId', example='d61be709-49d2-4cf1-b219-cd6181f72***'),
    liveness?: boolean(name='Liveness', example='true'),
    sourceImage?: string(name='SourceImage', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
    targetImage?: string(name='TargetImage', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  }(name='FaceRequest'),
}

model FaceRecognizeShrinkRequest {
  faceRequestShrink?: string(name='FaceRequest'),
}

model FaceRecognizeResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    comparePassed?: string(name='ComparePassed', example='T'),
    compareScore?: float(name='CompareScore', example='32.435'),
    livenessPassed?: string(name='LivenessPassed', example='T'),
    livenessScore?: float(name='LivenessScore', example='56.34'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4ba***'),
  success?: boolean(name='Success', example='True'),
}

model FaceRecognizeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FaceRecognizeResponseBody(name='body'),
}

async function faceRecognizeWithOptions(tmpReq: FaceRecognizeRequest, runtime: Util.RuntimeOptions): FaceRecognizeResponse {
  Util.validateModel(tmpReq);
  var request = new FaceRecognizeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.faceRequest)) {
    request.faceRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.faceRequest, 'FaceRequest', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.faceRequestShrink)) {
    body['FaceRequest'] = request.faceRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FaceRecognize',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function faceRecognize(request: FaceRecognizeRequest): FaceRecognizeResponse {
  var runtime = new Util.RuntimeOptions{};
  return faceRecognizeWithOptions(request, runtime);
}

model GetAppRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  clientVersion?: string(name='ClientVersion', example='1.0.002'),
  deviceId?: string(name='DeviceId', example='xxx-xxx-xxx'),
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  packageName?: string(name='PackageName', example='com.a.test'),
}

model GetAppResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    config?: string(name='Config', example='{}'),
    createdAt?: string(name='CreatedAt', example='1'),
    disabled?: string(name='Disabled', example='false'),
    feeId?: string(name='FeeId', example='ff1d7783-e087-4d62-92df-3a163eca7c07'),
    name?: string(name='Name'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAppResponseBody(name='body'),
}

async function getAppWithOptions(request: GetAppRequest, runtime: Util.RuntimeOptions): GetAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApp',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getApp(request: GetAppRequest): GetAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppWithOptions(request, runtime);
}

model GetAsrResultRequest {
  asrTaskId?: string(name='AsrTaskId', example='B2AADC9E-2A58-5918-AE4E-FF59E19D7***'),
}

model GetAsrResultResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    result?: string(name='Result'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='C14ED32C-B9E4-54E7-BA85-C2B562C5B***'),
  success?: boolean(name='Success', example='True'),
}

model GetAsrResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAsrResultResponseBody(name='body'),
}

async function getAsrResultWithOptions(request: GetAsrResultRequest, runtime: Util.RuntimeOptions): GetAsrResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.asrTaskId)) {
    query['AsrTaskId'] = request.asrTaskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAsrResult',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAsrResult(request: GetAsrResultRequest): GetAsrResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAsrResultWithOptions(request, runtime);
}

model GetDepartmentRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetDepartmentResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    description?: string(name='Description'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
    updatedAt?: string(name='UpdatedAt', example='2020-07-14T14:01:41.000+08:00'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDepartmentResponseBody(name='body'),
}

async function getDepartmentWithOptions(request: GetDepartmentRequest, runtime: Util.RuntimeOptions): GetDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDepartment',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDepartment(request: GetDepartmentRequest): GetDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDepartmentWithOptions(request, runtime);
}

model GetDetectProcessRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b87****'),
}

model GetDetectProcessResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-12-04T14:47:59.000+08:00'),
    draft?: string(name='Draft', example='{}'),
    id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
    md5?: string(name='Md5', example='987d563d38f5aef27feca8702c689bb1'),
    name?: string(name='Name'),
    newVersion?: boolean(name='NewVersion', example='true'),
    updatedAt?: string(name='UpdatedAt', example='2020-12-04T14:47:59.000+08:00'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='0q1c45cd-3eee-1e60-b505-2e330b8755d3'),
}

model GetDetectProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDetectProcessResponseBody(name='body'),
}

async function getDetectProcessWithOptions(request: GetDetectProcessRequest, runtime: Util.RuntimeOptions): GetDetectProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDetectProcess',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDetectProcess(request: GetDetectProcessRequest): GetDetectProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDetectProcessWithOptions(request, runtime);
}

model GetDetectProcessJsonFileRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', description='ID', example='hpsk3wdo-2020122319'),
}

model GetDetectProcessJsonFileResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='B2695011-0604-5557-9E00-B74F58AB3F2B'),
}

model GetDetectProcessJsonFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDetectProcessJsonFileResponseBody(name='body'),
}

async function getDetectProcessJsonFileWithOptions(request: GetDetectProcessJsonFileRequest, runtime: Util.RuntimeOptions): GetDetectProcessJsonFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetDetectProcessJsonFile',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDetectProcessJsonFile(request: GetDetectProcessJsonFileRequest): GetDetectProcessJsonFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDetectProcessJsonFileWithOptions(request, runtime);
}

model GetDetectionRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetDetectionResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    departmentName?: string(name='DepartmentName'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    recordingType?: string(name='RecordingType', example='local'),
    ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    ruleName?: string(name='RuleName', example='default'),
    status?: string(name='Status', example='runnable'),
    tasks?: [ 
      {
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        status?: string(name='Status', example='runnable'),
        videoMetaUrl?: string(name='VideoMetaUrl', example='http://oss.aliyun.com/1.mp4.meta'),
        videoUrl?: string(name='VideoUrl', example='http://oss.aliyun.com/1.mp4'),
      }
    ](name='Tasks'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDetectionResponseBody(name='body'),
}

async function getDetectionWithOptions(request: GetDetectionRequest, runtime: Util.RuntimeOptions): GetDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDetection',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDetection(request: GetDetectionRequest): GetDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDetectionWithOptions(request, runtime);
}

model GetPreSignedUrlRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  clientVersion?: string(name='ClientVersion', example='1.0.001'),
  prefix?: string(name='Prefix', example='test.mp4'),
}

model GetPreSignedUrlResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='http://shuanglu-pre.oss-cn-beijing.aliyuncs.com/13ba4081-84f3-42b0-af93-10a64319f8ef/test.txt'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetPreSignedUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPreSignedUrlResponseBody(name='body'),
}

async function getPreSignedUrlWithOptions(request: GetPreSignedUrlRequest, runtime: Util.RuntimeOptions): GetPreSignedUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.prefix)) {
    body['Prefix'] = request.prefix;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetPreSignedUrl',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPreSignedUrl(request: GetPreSignedUrlRequest): GetPreSignedUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPreSignedUrlWithOptions(request, runtime);
}

model GetRecordResultRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  recordId?: string(name='RecordId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
}

model GetRecordResultResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    appName?: string(name='AppName'),
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    departmentName?: string(name='DepartmentName'),
    detectProcessName?: string(name='DetectProcessName'),
    duration?: long(name='Duration', example='22'),
    id?: string(name='Id', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
    metaUrl?: string(name='MetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
    outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
    recordAt?: string(name='RecordAt', example='2020-07-14T14:01:41.000+08:00'),
    recordRoomList?: [ 
      {
        outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
        recordType?: string(name='RecordType', example='Mix'),
        role?: string(name='Role', example='21343'),
        roomMetaUrl?: string(name='RoomMetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
        roomRecordAt?: string(name='RoomRecordAt', example='2020-07-14T14:01:41.000+08:00'),
        roomResultUrl?: string(name='RoomResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
        roomStatus?: string(name='RoomStatus', example='runnable'),
        roomVideoUrl?: string(name='RoomVideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
        rtcRecordId?: string(name='RtcRecordId', example='record_65703154805715668342'),
      }
    ](name='RecordRoomList'),
    resultUrl?: string(name='ResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
    roomId?: string(name='RoomId', example='641981583353***'),
    status?: string(name='Status', example='completed'),
    videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
      message?: string(name='Message'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='requestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
  success?: boolean(name='Success', example='True'),
}

model GetRecordResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRecordResultResponseBody(name='body'),
}

async function getRecordResultWithOptions(request: GetRecordResultRequest, runtime: Util.RuntimeOptions): GetRecordResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRecordResult',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRecordResult(request: GetRecordResultRequest): GetRecordResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordResultWithOptions(request, runtime);
}

model GetRecordsByFeeIdRequest {
  feeId?: string(name='FeeId', example='6c94f2a7-632d-4ea0-aa06-a97800a9060f'),
}

model GetRecordsByFeeIdResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: [ 
    {
      appName?: string(name='AppName'),
      createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
      departmentName?: string(name='DepartmentName'),
      detectProcessName?: string(name='DetectProcessName'),
      duration?: long(name='Duration', example='22'),
      id?: string(name='Id', example='63bb629d-92bf-4cdc-ad0b-3032c926d23f'),
      metaUrl?: string(name='MetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
      outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
      recordAt?: string(name='RecordAt', example='2020-07-14T14:01:41.000+08:00'),
      recordRoomList?: [ 
        {
          outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
          recordType?: string(name='RecordType', example='Mix'),
          role?: string(name='Role', example='21343'),
          roomMetaUrl?: string(name='RoomMetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
          roomRecordAt?: string(name='RoomRecordAt', example='2020-07-14T14:01:41.000+08:00'),
          roomResultUrl?: string(name='RoomResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
          roomStatus?: string(name='RoomStatus', example='runnable'),
          roomVideoUrl?: string(name='RoomVideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
          rtcRecordId?: string(name='RtcRecordId', example='record_65703154805715668342'),
        }
      ](name='RecordRoomList'),
      resultUrl?: string(name='ResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
      roomId?: string(name='RoomId', example='654078150345590'),
      status?: string(name='Status', example='completed'),
      videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
    }
  ](name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='0B576AAB-A638-5029-9A54-A7C1DB5AC0B3'),
  success?: boolean(name='Success', example='True'),
}

model GetRecordsByFeeIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRecordsByFeeIdResponseBody(name='body'),
}

async function getRecordsByFeeIdWithOptions(request: GetRecordsByFeeIdRequest, runtime: Util.RuntimeOptions): GetRecordsByFeeIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.feeId)) {
    body['FeeId'] = request.feeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetRecordsByFeeId',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRecordsByFeeId(request: GetRecordsByFeeIdRequest): GetRecordsByFeeIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordsByFeeIdWithOptions(request, runtime);
}

model GetRecordsByOuterBusinessIdRequest {
  outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
}

model GetRecordsByOuterBusinessIdResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: [ 
    {
      appName?: string(name='AppName'),
      createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
      departmentName?: string(name='DepartmentName'),
      detectProcessName?: string(name='DetectProcessName'),
      duration?: long(name='Duration', example='22'),
      id?: string(name='Id', example='0f1c45cd-3eee-4e60-b505-2e330b875***'),
      metaUrl?: string(name='MetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
      outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
      recordAt?: string(name='RecordAt', example='2020-07-14T14:01:41.000+08:00'),
      recordRoomList?: [ 
        {
          outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
          recordType?: string(name='RecordType', example='Mix'),
          role?: string(name='Role', example='user'),
          roomMetaUrl?: string(name='RoomMetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
          roomRecordAt?: string(name='RoomRecordAt', example='2020-07-14T14:01:41.000+08:00'),
          roomResultUrl?: string(name='RoomResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
          roomStatus?: string(name='RoomStatus', example='1'),
          roomVideoUrl?: string(name='RoomVideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
          rtcRecordId?: string(name='RtcRecordId', example='record_65703154805715668342'),
        }
      ](name='RecordRoomList'),
      resultUrl?: string(name='ResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
      roomId?: string(name='RoomId', example='641981583353***'),
      status?: string(name='Status', example='COMPLETED'),
      videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
    }
  ](name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0***'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='0f1c45cd-3eee-4e60-b505-2e330b875***'),
  success?: boolean(name='Success', example='True'),
}

model GetRecordsByOuterBusinessIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRecordsByOuterBusinessIdResponseBody(name='body'),
}

async function getRecordsByOuterBusinessIdWithOptions(request: GetRecordsByOuterBusinessIdRequest, runtime: Util.RuntimeOptions): GetRecordsByOuterBusinessIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.outerBusinessId)) {
    query['OuterBusinessId'] = request.outerBusinessId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRecordsByOuterBusinessId',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRecordsByOuterBusinessId(request: GetRecordsByOuterBusinessIdRequest): GetRecordsByOuterBusinessIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordsByOuterBusinessIdWithOptions(request, runtime);
}

model GetRuleRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetRuleResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name', example='default'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRuleResponseBody(name='body'),
}

async function getRuleWithOptions(request: GetRuleRequest, runtime: Util.RuntimeOptions): GetRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRule',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRule(request: GetRuleRequest): GetRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRuleWithOptions(request, runtime);
}

model GetStatisticsRecordsByFeeIdRequest {
  feeId?: string(name='FeeId', example='ab7ce59f-a68a-4a6f-82a6-6460fadc9a70'),
}

model GetStatisticsRecordsByFeeIdResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: [ 
    {
      appId?: long(name='AppId', description='appid', example='12'),
      beginAt?: string(name='BeginAt', example='2022-05-23 10:33:12'),
      chargeDuration?: int32(name='ChargeDuration', example='12'),
      createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
      departmentId?: long(name='DepartmentId', example='12'),
      detectionDuration?: int32(name='DetectionDuration', example='1200'),
      deviceId?: string(name='DeviceId', example='7f3dfb9aa0dd0261'),
      deviceType?: int32(name='DeviceType', example='0'),
      endAt?: string(name='EndAt', example='2022-03-24 11:39:46'),
      feeId?: string(name='FeeId', example='ff1d7783-e087-4d62-92df-3a163eca7c07'),
      hour?: int32(name='Hour', example='2020050811'),
      tenantId?: long(name='TenantId', example='1'),
      type?: string(name='Type', example='REMOTE'),
      updatedAt?: string(name='UpdatedAt', example='2020-07-14T14:01:41.000+08:00'),
    }
  ](name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='-'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='CAD43A24-D34C-5848-BEB0-3D184F6687B1'),
  success?: boolean(name='Success', example='True'),
}

model GetStatisticsRecordsByFeeIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetStatisticsRecordsByFeeIdResponseBody(name='body'),
}

async function getStatisticsRecordsByFeeIdWithOptions(request: GetStatisticsRecordsByFeeIdRequest, runtime: Util.RuntimeOptions): GetStatisticsRecordsByFeeIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.feeId)) {
    body['FeeId'] = request.feeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetStatisticsRecordsByFeeId',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStatisticsRecordsByFeeId(request: GetStatisticsRecordsByFeeIdRequest): GetStatisticsRecordsByFeeIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStatisticsRecordsByFeeIdWithOptions(request, runtime);
}

model GetTaskRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  taskId?: string(name='TaskId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    status?: string(name='Status', example='runnable'),
    videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
}

model GetTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTaskResponseBody(name='body'),
}

async function getTaskWithOptions(request: GetTaskRequest, runtime: Util.RuntimeOptions): GetTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTask',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTask(request: GetTaskRequest): GetTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTaskWithOptions(request, runtime);
}

model GetTaskGroupRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetTaskGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    completedTasks?: int32(name='CompletedTasks', example='1'),
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
    ruleId?: string(name='RuleId', example='2020-07-14T14:01:41.000+08:00'),
    ruleName?: string(name='RuleName', example='default'),
    status?: string(name='Status', example='runnable'),
    taskIds?: [ string ](name='TaskIds', description='-'),
    totalTasks?: int32(name='TotalTasks', example='1'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetTaskGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTaskGroupResponseBody(name='body'),
}

/**
  * **1**
  *
  * @param request GetTaskGroupRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetTaskGroupResponse
 */
async function getTaskGroupWithOptions(request: GetTaskGroupRequest, runtime: Util.RuntimeOptions): GetTaskGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTaskGroup',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * **1**
  *
  * @param request GetTaskGroupRequest
  * @return GetTaskGroupResponse
 */
async function getTaskGroup(request: GetTaskGroupRequest): GetTaskGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTaskGroupWithOptions(request, runtime);
}

model GetTtsQuestionByGroupIdRequest {
  groupId?: string(name='GroupId', example='47584ba4-9781-496b-8e6f-c8525a213***'),
}

model GetTtsQuestionByGroupIdResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    groupId?: string(name='GroupId', example='47584ba4-9781-496b-8e6f-c8525a213***'),
    questions?: [ 
      {
        answer?: string(name='Answer'),
        duration?: double(name='Duration', example='674'),
        id?: long(name='Id', example='1'),
        ossUrl?: string(name='OssUrl', example='https://pts-data-f***.pcm'),
        question?: string(name='Question'),
        questionGroupId?: long(name='QuestionGroupId', example='47584ba4-9781-496b-8e6f-c8525a213***'),
        questionKey?: string(name='QuestionKey', example='47584ba4-9781-496b-8e6f-c8525a213***'),
        tenantId?: long(name='TenantId', example='2'),
      }
    ](name='Questions'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='D2DFCDC3-1ECF-599D-8EDA-8F598E5A9***'),
  success?: boolean(name='Success', example='True'),
}

model GetTtsQuestionByGroupIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTtsQuestionByGroupIdResponseBody(name='body'),
}

async function getTtsQuestionByGroupIdWithOptions(request: GetTtsQuestionByGroupIdRequest, runtime: Util.RuntimeOptions): GetTtsQuestionByGroupIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTtsQuestionByGroupId',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTtsQuestionByGroupId(request: GetTtsQuestionByGroupIdRequest): GetTtsQuestionByGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTtsQuestionByGroupIdWithOptions(request, runtime);
}

model GetUserRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    departments?: [ 
      {
        description?: string(name='Description'),
        gmtCreate?: string(name='GmtCreate', example='2020-07-14T14:01:41.000+08:00'),
        gmtModified?: string(name='GmtModified', example='2020-07-14T14:01:41.000+08:00'),
        id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        name?: string(name='Name'),
      }
    ](name='Departments'),
    email?: string(name='Email', example='xxx@aa.com'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
    phoneNumber?: string(name='PhoneNumber', example='187000023323'),
    role?: string(name='Role', example='admin'),
    source?: string(name='Source', example='ram'),
    updatedAt?: string(name='UpdatedAt', example='2020-07-14T14:01:41.000+08:00'),
    username?: string(name='Username', example='test'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserResponseBody(name='body'),
}

async function getUserWithOptions(request: GetUserRequest, runtime: Util.RuntimeOptions): GetUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUser',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUser(request: GetUserRequest): GetUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserWithOptions(request, runtime);
}

model GetVideoMergeTaskRequest {
  taskId?: string(name='TaskId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model GetVideoMergeTaskResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    clientTraceId?: string(name='ClientTraceId', example='2fr4fa55-2364-4d79-aeb4-c093ec4a4fd4'),
    duration?: float(name='Duration', example='22'),
    height?: int32(name='Height', example='0.6'),
    mergeFileId?: string(name='MergeFileId', example='http://xxx.mp4'),
    taskId?: string(name='TaskId', example='368cfa55-2364-4d79-aeb4-c0956c4a45cd'),
    width?: int32(name='Width', example='0.6'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='89A61EB9-2FF8-595D-89D3-845C8B615011'),
  success?: boolean(name='Success', example='True'),
}

model GetVideoMergeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoMergeTaskResponseBody(name='body'),
}

async function getVideoMergeTaskWithOptions(request: GetVideoMergeTaskRequest, runtime: Util.RuntimeOptions): GetVideoMergeTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetVideoMergeTask',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getVideoMergeTask(request: GetVideoMergeTaskRequest): GetVideoMergeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getVideoMergeTaskWithOptions(request, runtime);
}

model GetWatermarkRequest {
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  clientVersion?: string(name='ClientVersion', example='1.0.003'),
  watermarkId?: string(name='WatermarkId', example='728fd812a876ec04818858982baebe6f'),
}

model GetWatermarkResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name'),
    value?: string(name='Value', example='{}'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
  success?: boolean(name='Success', example='True'),
}

model GetWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWatermarkResponseBody(name='body'),
}

async function getWatermarkWithOptions(request: GetWatermarkRequest, runtime: Util.RuntimeOptions): GetWatermarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  if (!Util.isUnset(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWatermark',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWatermark(request: GetWatermarkRequest): GetWatermarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWatermarkWithOptions(request, runtime);
}

model JoinRoomRequest {
  appId?: string(name='AppId', example='4a29b426-742f-4078-8386-79b440b***'),
  roomId?: string(name='RoomId', example='66194***681868'),
  roomToken?: string(name='RoomToken', example='006f4***b269'),
  streamId?: string(name='StreamId', example='12312***2412'),
}

model JoinRoomResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    roomId?: string(name='RoomId', example='641981583353***'),
    streamId?: string(name='StreamId', example='12312***412'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='D15744FC-97D2-5D61-A18C-8CC4FA0A3***'),
  success?: boolean(name='Success', example='True'),
}

model JoinRoomResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: JoinRoomResponseBody(name='body'),
}

async function joinRoomWithOptions(request: JoinRoomRequest, runtime: Util.RuntimeOptions): JoinRoomResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.roomId)) {
    query['RoomId'] = request.roomId;
  }
  if (!Util.isUnset(request.roomToken)) {
    query['RoomToken'] = request.roomToken;
  }
  if (!Util.isUnset(request.streamId)) {
    query['StreamId'] = request.streamId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'JoinRoom',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function joinRoom(request: JoinRoomRequest): JoinRoomResponse {
  var runtime = new Util.RuntimeOptions{};
  return joinRoomWithOptions(request, runtime);
}

model LeaveRoomRequest {
  roomId?: string(name='RoomId', example='661940620884***'),
}

model LeaveRoomResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: string(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='8F5F961D-07AA-5293-BFFE-32CDC251***'),
  success?: boolean(name='Success', example='True'),
}

model LeaveRoomResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LeaveRoomResponseBody(name='body'),
}

async function leaveRoomWithOptions(request: LeaveRoomRequest, runtime: Util.RuntimeOptions): LeaveRoomResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.roomId)) {
    query['RoomId'] = request.roomId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LeaveRoom',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function leaveRoom(request: LeaveRoomRequest): LeaveRoomResponse {
  var runtime = new Util.RuntimeOptions{};
  return leaveRoomWithOptions(request, runtime);
}

model ListAppsRequest {
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListAppsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        departmentName?: string(name='DepartmentName'),
        disabled?: boolean(name='Disabled', example='false'),
        id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        name?: string(name='Name'),
        packageName?: string(name='PackageName', example='com.aaa.test'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='11'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppsResponseBody(name='body'),
}

async function listAppsWithOptions(request: ListAppsRequest, runtime: Util.RuntimeOptions): ListAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApps',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listApps(request: ListAppsRequest): ListAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppsWithOptions(request, runtime);
}

model ListDepartmentsRequest {
  name?: string(name='Name'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  userId?: string(name='UserId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListDepartmentsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        administrators?: [ 
          {
            id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
            name?: string(name='Name', example='user'),
          }
        ](name='Administrators'),
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        description?: string(name='Description'),
        id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        name?: string(name='Name'),
        updatedAt?: string(name='UpdatedAt', example='2020-07-14T14:01:41.000+08:00'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='11'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListDepartmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDepartmentsResponseBody(name='body'),
}

async function listDepartmentsWithOptions(request: ListDepartmentsRequest, runtime: Util.RuntimeOptions): ListDepartmentsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDepartments',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDepartments(request: ListDepartmentsRequest): ListDepartmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDepartmentsWithOptions(request, runtime);
}

model ListDetectProcessesRequest {
  name?: string(name='Name'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  publishStatus?: boolean(name='PublishStatus', example='true'),
  sort?: string(name='Sort', example='desc'),
  sortKey?: string(name='SortKey', example='CONTENT'),
  type?: string(name='Type', example='LOCAL'),
}

model ListDetectProcessesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        content?: string(name='Content', example='{}'),
        contentAt?: string(name='ContentAt', example='2020-12-04T14:48:59.000+08:00'),
        createdAt?: string(name='CreatedAt', example='2020-12-04T14:47:59.000+08:00'),
        draft?: string(name='Draft', example='{}'),
        draftAt?: string(name='DraftAt', example='2020-12-04T14:48:59.000+08:00'),
        fileUrl?: string(name='FileUrl', example='http://abc.com/123.json'),
        id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
        md5?: string(name='Md5', example='987d563d38f5aef27feca8702c689bb1'),
        name?: string(name='Name'),
        newVersion?: boolean(name='NewVersion', example='true'),
        published?: boolean(name='Published', example='True'),
        type?: string(name='Type', example='REMOTE'),
        updatedAt?: string(name='UpdatedAt', example='2020-12-04T14:48:59.000+08:00'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='100'),
    totalPages?: int32(name='TotalPages', example='10'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='bf1c45cd-3eee-4e60-b505-2e330bf755d3'),
}

model ListDetectProcessesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDetectProcessesResponseBody(name='body'),
}

async function listDetectProcessesWithOptions(request: ListDetectProcessesRequest, runtime: Util.RuntimeOptions): ListDetectProcessesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.publishStatus)) {
    query['PublishStatus'] = request.publishStatus;
  }
  if (!Util.isUnset(request.sort)) {
    query['Sort'] = request.sort;
  }
  if (!Util.isUnset(request.sortKey)) {
    query['SortKey'] = request.sortKey;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDetectProcesses',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDetectProcesses(request: ListDetectProcessesRequest): ListDetectProcessesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDetectProcessesWithOptions(request, runtime);
}

model ListDetectionsRequest {
  createDateFrom?: string(name='CreateDateFrom', example='2020-10-10'),
  createDateTo?: string(name='CreateDateTo', example='2020-10-11'),
  departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  recordingType?: string(name='RecordingType', example='local'),
  ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListDetectionsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        departmentName?: string(name='DepartmentName'),
        id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        recordingType?: string(name='RecordingType', example='local'),
        ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        ruleName?: string(name='RuleName', example='default'),
        status?: string(name='Status', example='runnable'),
        tasks?: [ 
          {
            createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
            id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
            status?: string(name='Status', example='runnable'),
            videoMetaUrl?: string(name='VideoMetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
            videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
          }
        ](name='Tasks'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='11'),
  }(name='Data', description='-'),
  errors?: [ 
    {
      field?: string(name='Field', example='status'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors', description='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListDetectionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDetectionsResponseBody(name='body'),
}

async function listDetectionsWithOptions(request: ListDetectionsRequest, runtime: Util.RuntimeOptions): ListDetectionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.createDateFrom)) {
    query['CreateDateFrom'] = request.createDateFrom;
  }
  if (!Util.isUnset(request.createDateTo)) {
    query['CreateDateTo'] = request.createDateTo;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.recordingType)) {
    query['RecordingType'] = request.recordingType;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDetections',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDetections(request: ListDetectionsRequest): ListDetectionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDetectionsWithOptions(request, runtime);
}

model ListFilesRequest {
  limit?: int32(name='Limit', example='500'),
  prefix?: string(name='Prefix', example='20220110/'),
}

model ListFilesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='[\\"d0388a41-30c6-4c74-af83-a1f923ce1725/process/\\", \\"d0388a41-30c6-4c74-af83-a1f923ce1725/video_12_14_09_05_41.mp4\\", \\"d0388a41-30c6-4c74-af83-a1f923ce1725/video_12_14_09_05_41.mp4.meta\\"]'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFilesResponseBody(name='body'),
}

async function listFilesWithOptions(request: ListFilesRequest, runtime: Util.RuntimeOptions): ListFilesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.prefix)) {
    query['Prefix'] = request.prefix;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFiles',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFiles(request: ListFilesRequest): ListFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFilesWithOptions(request, runtime);
}

model ListRecordResultsRequest {
  createDateFrom?: string(name='CreateDateFrom', example='2020-10-10'),
  createDateTo?: string(name='CreateDateTo', example='2020-10-11'),
  departmentId?: string(name='DepartmentId', example='90c2459a-4c73-4ab7-8a6b-e550d62fbd8c'),
  outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  recordId?: string(name='RecordId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
  type?: string(name='Type', example='LOCAL'),
}

model ListRecordResultsResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    items?: [ 
      {
        appName?: string(name='AppName', example='myapp'),
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        departmentName?: string(name='DepartmentName'),
        detectProcessName?: string(name='DetectProcessName', example='process name'),
        duration?: long(name='Duration', example='22'),
        id?: string(name='Id', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
        metaUrl?: string(name='MetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
        outerBusinessId?: string(name='OuterBusinessId', example='fasfasda'),
        recordAt?: string(name='RecordAt', example='2020-07-14T14:01:41.000+08:00'),
        resultUrl?: string(name='ResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
        roomId?: string(name='RoomId', example='642662467657798'),
        rtcRecordId?: string(name='RtcRecordId', example='record_65703154805715668342'),
        status?: string(name='Status', example='runnable'),
        videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='10'),
    totalPages?: int32(name='TotalPages', example='11'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='requestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
  success?: boolean(name='Success', example='True'),
}

model ListRecordResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRecordResultsResponseBody(name='body'),
}

async function listRecordResultsWithOptions(request: ListRecordResultsRequest, runtime: Util.RuntimeOptions): ListRecordResultsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.createDateFrom)) {
    query['CreateDateFrom'] = request.createDateFrom;
  }
  if (!Util.isUnset(request.createDateTo)) {
    query['CreateDateTo'] = request.createDateTo;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.outerBusinessId)) {
    query['OuterBusinessId'] = request.outerBusinessId;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRecordResults',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRecordResults(request: ListRecordResultsRequest): ListRecordResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRecordResultsWithOptions(request, runtime);
}

model ListRulesRequest {
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
}

model ListRulesResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        content?: string(name='Content', example='{}'),
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        name?: string(name='Name', example='default'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='1'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRulesResponseBody(name='body'),
}

async function listRulesWithOptions(request: ListRulesRequest, runtime: Util.RuntimeOptions): ListRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRules',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRules(request: ListRulesRequest): ListRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRulesWithOptions(request, runtime);
}

model ListTaskGroupsRequest {
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  status?: string(name='Status', example='runnable'),
}

model ListTaskGroupsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        completedTasks?: int32(name='CompletedTasks', example='0'),
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        name?: string(name='Name'),
        ruleId?: string(name='RuleId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        ruleName?: string(name='RuleName', example='default'),
        status?: string(name='Status', example='runnable'),
        taskIds?: [ string ](name='TaskIds'),
        totalTasks?: int32(name='TotalTasks', example='1'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='1'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListTaskGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTaskGroupsResponseBody(name='body'),
}

async function listTaskGroupsWithOptions(request: ListTaskGroupsRequest, runtime: Util.RuntimeOptions): ListTaskGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTaskGroups',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTaskGroups(request: ListTaskGroupsRequest): ListTaskGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskGroupsWithOptions(request, runtime);
}

model ListTaskItemsRequest {
  taskId?: string(name='TaskId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListTaskItemsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
      message?: string(name='Message'),
      name?: string(name='Name'),
      output?: string(name='Output', example='{}'),
      segmentSeq?: long(name='SegmentSeq', example='1'),
      status?: string(name='Status', example='completed'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListTaskItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTaskItemsResponseBody(name='body'),
}

async function listTaskItemsWithOptions(request: ListTaskItemsRequest, runtime: Util.RuntimeOptions): ListTaskItemsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTaskItems',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTaskItems(request: ListTaskItemsRequest): ListTaskItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskItemsWithOptions(request, runtime);
}

model ListTasksRequest {
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  taskGroupId?: string(name='TaskGroupId', example='1'),
}

model ListTasksResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
        status?: string(name='Status', example='runnable'),
        videoMetaUrl?: string(name='VideoMetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta?expire=2010323&sign=sf2324'),
        videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4?expire=2010323&sign=sf2324'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='1'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTasksResponseBody(name='body'),
}

async function listTasksWithOptions(request: ListTasksRequest, runtime: Util.RuntimeOptions): ListTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskGroupId)) {
    query['TaskGroupId'] = request.taskGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTasks',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTasks(request: ListTasksRequest): ListTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTasksWithOptions(request, runtime);
}

model ListUsersRequest {
  departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  username?: string(name='Username', example='tom'),
}

model ListUsersResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    items?: [ 
      {
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        departments?: [ 
          {
            createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
            description?: string(name='Description'),
            id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
            name?: string(name='Name'),
            updatedAt?: string(name='UpdatedAt', example='2020-07-14T14:01:41.000+08:00'),
          }
        ](name='Departments'),
        email?: string(name='Email', example='a@a.com'),
        id?: string(name='Id', description='ID', example='2020-07-14T14:01:41.000+08:00'),
        name?: string(name='Name'),
        phoneNumber?: string(name='PhoneNumber', example='186000000'),
        ramUsername?: string(name='RamUsername', example='xxx'),
        role?: string(name='Role', example='admin'),
        source?: string(name='Source', example='ram'),
        updatedAt?: string(name='UpdatedAt', example='2020-07-14T14:01:41.000+08:00'),
        username?: string(name='Username', example='xxx'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='10'),
    totalPages?: int32(name='TotalPages', example='1'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model ListUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUsersResponseBody(name='body'),
}

async function listUsersWithOptions(request: ListUsersRequest, runtime: Util.RuntimeOptions): ListUsersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.username)) {
    query['Username'] = request.username;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUsers',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUsers(request: ListUsersRequest): ListUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUsersWithOptions(request, runtime);
}

model ListWatermarksRequest {
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListWatermarksResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    items?: [ 
      {
        createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
        id?: string(name='Id', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
        name?: string(name='Name'),
        value?: string(name='Value', example='{}'),
      }
    ](name='Items'),
    totalElements?: long(name='TotalElements', example='1'),
    totalPages?: int32(name='TotalPages', example='1'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
  success?: boolean(name='Success', example='True'),
}

model ListWatermarksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWatermarksResponseBody(name='body'),
}

async function listWatermarksWithOptions(request: ListWatermarksRequest, runtime: Util.RuntimeOptions): ListWatermarksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWatermarks',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listWatermarks(request: ListWatermarksRequest): ListWatermarksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWatermarksWithOptions(request, runtime);
}

model RenameDetectProcessRequest {
  id?: string(name='Id', description='ID', example='1q1c45cd-3eee-1e60-b505-2e330b8755d2'),
  name?: string(name='Name'),
}

model RenameDetectProcessResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-12-04T14:47:59.000+08:00'),
    draft?: string(name='Draft', example='{}'),
    id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
    md5?: string(name='Md5', example='987d563d38f5aef27feca8702c689bb1'),
    name?: string(name='Name'),
  }(name='Data'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='db1c45cd-3eee-1e60-b505-2e330b8755d2'),
}

model RenameDetectProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenameDetectProcessResponseBody(name='body'),
}

async function renameDetectProcessWithOptions(request: RenameDetectProcessRequest, runtime: Util.RuntimeOptions): RenameDetectProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RenameDetectProcess',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function renameDetectProcess(request: RenameDetectProcessRequest): RenameDetectProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return renameDetectProcessWithOptions(request, runtime);
}

model TtsCommonRequest {
  ttsRequest?: {
    appId?: string(name='AppId', description='appid', example='d61be709-49d2-4cf1-b219-cd6181f72***'),
    format?: string(name='Format', example='WAV'),
    pitchRate?: int32(name='PitchRate', example='50'),
    sampleRate?: int32(name='SampleRate', example='16000'),
    speechRate?: int32(name='SpeechRate', example='50'),
    text?: string(name='Text'),
    voice?: string(name='Voice', example='Xiaoyun'),
    volume?: int32(name='Volume', example='50'),
  }(name='TtsRequest'),
}

model TtsCommonShrinkRequest {
  ttsRequestShrink?: string(name='TtsRequest'),
}

model TtsCommonResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    code?: int32(name='Code', example='20000000'),
    id?: string(name='Id', example='63bb629d-92bf-4cdc-ad0b-3032c926****'),
    message?: string(name='Message', example='-'),
    name?: string(name='Name'),
    publicUrl?: string(name='PublicUrl', example='http://idrs-daily.oss-cn-beijing.aliyuncs.com/mode/android/model.zip?Expires=1607004612&OSSAccessKeyId=LTAI4FcsdDhFc7h78gqB****&Signature=XXXXX'),
    taskId?: string(name='TaskId', example='368cfa55-2364-4d79-aeb4-c0956c4a****'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='c761f0ec-107c-43dc-8565-45330e10e11b'),
  success?: boolean(name='Success', example='True'),
}

model TtsCommonResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TtsCommonResponseBody(name='body'),
}

async function ttsCommonWithOptions(tmpReq: TtsCommonRequest, runtime: Util.RuntimeOptions): TtsCommonResponse {
  Util.validateModel(tmpReq);
  var request = new TtsCommonShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.ttsRequest)) {
    request.ttsRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ttsRequest, 'TtsRequest', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.ttsRequestShrink)) {
    body['TtsRequest'] = request.ttsRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TtsCommon',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function ttsCommon(request: TtsCommonRequest): TtsCommonResponse {
  var runtime = new Util.RuntimeOptions{};
  return ttsCommonWithOptions(request, runtime);
}

model TtsTaskRequest {
  request?: {
    key?: string(name='Key', example='d9ee5df9-20bf-47bf-987a-76b26984b***'),
    roomId?: string(name='RoomId', example='655259585579***'),
    timestamp?: long(name='Timestamp', example='1662271315039'),
  }(name='Request'),
}

model TtsTaskShrinkRequest {
  requestShrink?: string(name='Request'),
}

model TtsTaskResponseBody = {
  code?: int32(name='Code', example='OK'),
  data?: {
    answer?: string(name='Answer'),
    duration?: double(name='Duration', example='727'),
    question?: string(name='Question'),
    speechRate?: int32(name='SpeechRate', example='64'),
  }(name='Data'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='16A4A091-98BE-55F4-92D1-21590658***'),
  success?: boolean(name='Success', example='True'),
}

model TtsTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TtsTaskResponseBody(name='body'),
}

async function ttsTaskWithOptions(tmpReq: TtsTaskRequest, runtime: Util.RuntimeOptions): TtsTaskResponse {
  Util.validateModel(tmpReq);
  var request = new TtsTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.request)) {
    request.requestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.request, 'Request', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.requestShrink)) {
    body['Request'] = request.requestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TtsTask',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function ttsTask(request: TtsTaskRequest): TtsTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return ttsTaskWithOptions(request, runtime);
}

model UpdateAppRequest {
  departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  disabled?: boolean(name='Disabled', example='false'),
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  name?: string(name='Name'),
  packageName?: string(name='PackageName', example='com.aliyun.idrs.sdk'),
}

model UpdateAppResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
}

model UpdateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAppResponseBody(name='body'),
}

async function updateAppWithOptions(request: UpdateAppRequest, runtime: Util.RuntimeOptions): UpdateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.disabled)) {
    query['Disabled'] = request.disabled;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApp',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateApp(request: UpdateAppRequest): UpdateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppWithOptions(request, runtime);
}

model UpdateDepartmentRequest {
  description?: string(name='Description'),
  id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  label?: string(name='Label'),
  name?: string(name='Name'),
}

model UpdateDepartmentResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model UpdateDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDepartmentResponseBody(name='body'),
}

async function updateDepartmentWithOptions(request: UpdateDepartmentRequest, runtime: Util.RuntimeOptions): UpdateDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.label)) {
    body['Label'] = request.label;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDepartment',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDepartment(request: UpdateDepartmentRequest): UpdateDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDepartmentWithOptions(request, runtime);
}

model UpdateDetectProcessRequest {
  content?: string(name='Content', example='{}'),
  draft?: string(name='Draft', example='{}'),
  id?: string(name='Id', description='ID', example='0f1c45cd-3eee-4e60-b505-2e330b8755d3'),
  name?: string(name='Name'),
}

model UpdateDetectProcessResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-12-04T14:47:59.000+08:00'),
    draft?: string(name='Draft', example='{}'),
    id?: string(name='Id', description='ID', example='cd1c45cd-3eee-4e60-b505-2e330b8755d3'),
    md5?: string(name='Md5', example='987d563d38f5aef27feca8702c689bb1'),
    name?: string(name='Name'),
  }(name='Data'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', example='0c1c45cd-3eee-4e60-b505-2e330b8755d3'),
}

model UpdateDetectProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDetectProcessResponseBody(name='body'),
}

/**
  * ********
  *
  * @param request UpdateDetectProcessRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return UpdateDetectProcessResponse
 */
async function updateDetectProcessWithOptions(request: UpdateDetectProcessRequest, runtime: Util.RuntimeOptions): UpdateDetectProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.draft)) {
    query['Draft'] = request.draft;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDetectProcess',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * ********
  *
  * @param request UpdateDetectProcessRequest
  * @return UpdateDetectProcessResponse
 */
async function updateDetectProcess(request: UpdateDetectProcessRequest): UpdateDetectProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDetectProcessWithOptions(request, runtime);
}

model UpdateRuleRequest {
  content?: string(name='Content'),
  id?: string(name='Id', description='ID', example='Id'),
  name?: string(name='Name'),
}

model UpdateRuleResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    content?: string(name='Content', example='{}'),
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', description='ID', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
    name?: string(name='Name', example='default'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
}

model UpdateRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRuleResponseBody(name='body'),
}

async function updateRuleWithOptions(request: UpdateRuleRequest, runtime: Util.RuntimeOptions): UpdateRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRule',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRule(request: UpdateRuleRequest): UpdateRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRuleWithOptions(request, runtime);
}

model UpdateUserRequest {
  email?: string(name='Email', example='xxx@xxx.com'),
  id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  name?: string(name='Name'),
  phoneNumber?: string(name='PhoneNumber'),
  role?: string(name='Role', example='user'),
}

model UpdateUserResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data', example='{\\"Id\\": \\"5073e5f4-99c6-4bb1-bd6c-30ab12f11059\\", \\"CreatedAt\\": \\"2021-12-29T11:31:53.072+08:00\\"}'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
}

model UpdateUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserResponseBody(name='body'),
}

async function updateUserWithOptions(request: UpdateUserRequest, runtime: Util.RuntimeOptions): UpdateUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.role)) {
    query['Role'] = request.role;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateUser',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateUser(request: UpdateUserRequest): UpdateUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateUserWithOptions(request, runtime);
}

model UpdateWatermarkRequest {
  name?: string(name='Name'),
  value?: string(name='Value', example='{}'),
  watermarkId?: string(name='WatermarkId', example='d4ba1e0428a8df069316060cef41948a'),
}

model UpdateWatermarkResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    id?: string(name='Id', example='f3bd31c0-0001-4b4b-977d-7cfa64b585f5'),
    name?: string(name='Name'),
    value?: string(name='Value', example='{}'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field', example='A1899517-BB99-5D3E-A71B-97524DCB0942'),
      message?: string(name='Message', example='-'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message', example='-'),
  requestId?: string(name='RequestId', description='requestId', example='84118BF0-56F7-54D2-8C1A-35BBBBD5016B'),
  success?: boolean(name='Success', example='True'),
}

model UpdateWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWatermarkResponseBody(name='body'),
}

async function updateWatermarkWithOptions(request: UpdateWatermarkRequest, runtime: Util.RuntimeOptions): UpdateWatermarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  if (!Util.isUnset(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateWatermark',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateWatermark(request: UpdateWatermarkRequest): UpdateWatermarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateWatermarkWithOptions(request, runtime);
}

model UploadReportRequest {
  appId?: string(name='AppId', example='90c2459a-4c73-4ab7-8a6b-e550d62fbd8c'),
  clientBaseParam?: string(name='ClientBaseParam', example='{"version":"1.0.0"}'),
  clientVersion?: string(name='ClientVersion', example='1.0.003'),
  departmentId?: string(name='DepartmentId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad38'),
  detectProcessId?: string(name='DetectProcessId', example='iuhptk3w-2021122017'),
  duration?: long(name='Duration', example='12'),
  feeId?: string(name='FeeId', example='6c94f2a7-632d-4ea0-aa06-a97800a9060f'),
  metaUrl?: string(name='MetaUrl', example='http://abc.oss.aliyuncs.com/1/12_03_20_03_36toubaoren.mp4.meta'),
  outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
  recordAt?: string(name='RecordAt', example='2022-01-04T08%3A45%3A37Z'),
  resultUrl?: string(name='ResultUrl', example='http://abc.oss.aliyuncs.com/1/12_03_20_03_36toubaoren.mp4.json'),
  role?: string(name='Role'),
  roomId?: string(name='RoomId', example='6000028888875'),
  rtcRecordId?: string(name='RtcRecordId', example='record_6570315480571566****'),
  type?: string(name='Type', example='LOCAL'),
  userId?: string(name='UserId', example='59b0bbfe-929b-4a8c-9833-3ce70b4bad34'),
  videoType?: string(name='VideoType'),
  videoUrl?: string(name='VideoUrl', example='https://mogo-apps-sh.oss-cn-shanghai-internal.aliyuncs.com/tmp/d2720028b53d384c6d3fca32e45209d1_20_src.mp4'),
}

model UploadReportResponseBody = {
  code?: string(name='Code', description='code', example='OK'),
  data?: {
    createdAt?: string(name='CreatedAt', example='2020-07-14T14:01:41.000+08:00'),
    duration?: long(name='Duration', example='12'),
    id?: string(name='Id', example='59b0bbfe-929b-4a8c-9833-3ce7****'),
    metaUrl?: string(name='MetaUrl', example='http://oss.aliyuncs.com/1.mp4.meta'),
    outerBusinessId?: string(name='OuterBusinessId', example='ads32efef43'),
    recordAt?: string(name='RecordAt', example='2020-07-14T14:01:41.000+08:00'),
    resultUrl?: string(name='ResultUrl', example='http://oss.aliyuncs.com/1.mp4.json'),
    rtcRecordId?: string(name='RtcRecordId', example='record_6570315480571566****'),
    videoUrl?: string(name='VideoUrl', example='http://oss.aliyuncs.com/1.mp4'),
  }(name='Data'),
  errors?: [ 
    {
      field?: string(name='Field'),
      message?: string(name='Message'),
    }
  ](name='Errors'),
  httpCode?: int32(name='HttpCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='requestId', example='84118BF0-56F7-54D2-8C1A-35BBBB*****'),
  success?: boolean(name='Success', example='True'),
}

model UploadReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadReportResponseBody(name='body'),
}

async function uploadReportWithOptions(request: UploadReportRequest, runtime: Util.RuntimeOptions): UploadReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.clientBaseParam)) {
    query['ClientBaseParam'] = request.clientBaseParam;
  }
  if (!Util.isUnset(request.clientVersion)) {
    query['ClientVersion'] = request.clientVersion;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.detectProcessId)) {
    query['DetectProcessId'] = request.detectProcessId;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.feeId)) {
    query['FeeId'] = request.feeId;
  }
  if (!Util.isUnset(request.metaUrl)) {
    query['MetaUrl'] = request.metaUrl;
  }
  if (!Util.isUnset(request.outerBusinessId)) {
    query['OuterBusinessId'] = request.outerBusinessId;
  }
  if (!Util.isUnset(request.recordAt)) {
    query['RecordAt'] = request.recordAt;
  }
  if (!Util.isUnset(request.resultUrl)) {
    query['ResultUrl'] = request.resultUrl;
  }
  if (!Util.isUnset(request.role)) {
    query['Role'] = request.role;
  }
  if (!Util.isUnset(request.roomId)) {
    query['RoomId'] = request.roomId;
  }
  if (!Util.isUnset(request.rtcRecordId)) {
    query['RtcRecordId'] = request.rtcRecordId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.videoType)) {
    query['VideoType'] = request.videoType;
  }
  if (!Util.isUnset(request.videoUrl)) {
    query['VideoUrl'] = request.videoUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UploadReport',
    version = '2020-06-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function uploadReport(request: UploadReportRequest): UploadReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return uploadReportWithOptions(request, runtime);
}

